/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-09-01 11:38:33
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-09-01 14:11:50
 * @FilePath: \shihuan\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
//藏品换成版权
import Vue from 'vue'
import App from './App'
import * as Api from './config/api.js'
import uView from '@/uni_modules/uview-ui'

import * as Common from './config/common.js'
import * as Db from './config/db.js'
import * as Config from './config/config.js'
import store from './store'
import mixin from './common/mixins.js';
Vue.use(mixin);
export const EventBus = new Vue()
//	import {EventBus} from '@/main.js'
	// 监听事件
	EventBus.$on('messageFromH5', (data) => {
	  // 处理来自web-view的消息
	  uni.reLaunch({
	  	url: '/pages/index/index'
	  })
	  console.log('收到来自H5页面的消息：', data)
	})
import './common/uni-H5Api'
// #ifdef H5
import * as wx from './static/js/wx.js'
// 需要使用到uni.webview.js的一些方法
import * as webUni from '@/common/uni_webview.js'
document.addEventListener('UniAppJSBridgeReady', () => {
	// 将uniWebView赋值给vue原型，方便调用
	Vue.prototype.$webUni = webUni
});
// #endif
Vue.use(uView);
Vue.config.productionTip = false
Vue.prototype.$api = Api;
Vue.prototype.$common = Common;
Vue.prototype.$db = Db;
Vue.prototype.$config = Config;
Vue.prototype.$store = store;

//邀请下载二维码
// #ifdef H5
 import VueCanvasPoster from 'vue-canvas-poster'
 Vue.use(VueCanvasPoster)
// #endif


Vue.filter("fp", function(value) {
	if (!value) {
		return '0.00';
	}
	return Number(value / 100).toFixed(2)
})
Vue.filter("fp_m", function(value) {
	if (!value) {
		return '￥0.00';
	}
	return '￥' + Number(value / 100).toFixed(2)
})
// #ifdef H5
Vue.prototype.$wx = wx;
// #endif

App.mpType = 'app'

const app = new Vue({
	...App,
	store,
})
app.$mount()

// #ifdef H5
// import Vconsole from 'vconsole'
// let vConsole = new Vconsole();
// export default vConsole
// #endif


